package com.hulang.sms.sending.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;

import com.hulang.sms.sending.bean.SendHistory;
import com.hulang.sms.sending.bean.SumParam;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Repository
public interface SendHistoryMapper extends BaseMapper<SendHistory> {

    String tableName = "t_aliyun_send_history";

    @Select("select count(*) from " + tableName + " where sendIp = #{sendIp} and sendResult = 1 and sendTm > #{startTm} and sendTm < #{endTm}")
    int sumSingleIpOneDaySendNum(SumParam sumParam);


    @Select("select count(*) from " + tableName + " where phone = #{phone} and sendResult = 1 and sendTm > #{startTm} and sendTm < #{endTm}")
    int sumSinglePhoneOneDaySendNum(SumParam sumParam);
}
